<template>
  <div style="text-align:center;margin-top:15px;">
    <divider>我的邀请二维码</divider>
    <div id='inviteQr'>
    </div>
   </div>
</template>



<script>
import { Qrcode, Divider } from 'vux'

export default {
  mounted () {
    setInterval(() => {
      this.value = `https://vux.li?t=${Math.random()}`
      this.fgColor = `#${Math.floor(Math.random() * 16777215).toString(16)}`
    }, 1000)
    let config = {
      headers: {'X-Requested-With': 'XMLHttpRequest', 'Content-Type': 'application/json', 'Accept': 'application/json'},
      data: {
        '2323': '33',
        'orgNo': 'orgNo',
        'lastName': 'orgNo',
        'email': 'orgNo',
        'currentPage': '0',
        '233223': '0',
        'pageSize': '10',
        'customerId': '1'
      },
      responseType: 'json',
      method: 'post'
    }
    this.$ajax('api/cms/me/createInviteQrCode', config).then(function (response) {
      console.log(response)
      console.log(response.data.data.length)
      var img = new Image()
      img.src = 'data:image/gif;base64,' + response.data.data.img
      img.setAttribute('style', 'height: 400px;')
      document.getElementById('inviteQr').appendChild(img)
    }).catch(function (error) {
      console.log(error)
    })
  },
  components: {
    Qrcode,
    Divider
  },
  data () {
    return {
      qrcodeUrl: '',
      qrcodeSize: 80
    }
  }
}
</script>

<style lang="less" scoped>

</style>
